home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / mail / thor201.lha / THOR_2.0 / thor.lha / rexx / examples / CountFiles.br < prev    next >
Text File  |  1995-05-15  |  872b  |  51 lines

  1. /* CountFiles.br 
  2.  * 
  3.  * Count the files in a file database..
  4.  */
  5.  
  6.     parse arg argument
  7.  
  8.     if(argument = '') then
  9.     do
  10.         say '$VER: CountFiles.br V3.1 (27.01.95)'
  11.         say 'Template: BBSNAME/A'
  12.         exit
  13.     end
  14.  
  15.     if ~show('p', 'BBSREAD') then do
  16.         address command
  17.             "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  18.             "WaitForPort BBSREAD"
  19.     end
  20.     
  21.     address BBSREAD
  22.  
  23.     GETFAREALIST stem FAREALIST argument 
  24.     if(rc ~= 0) then 
  25.     do
  26.         say BBSREAD.LASTERROR
  27.         exit
  28.     end
  29.  
  30.     files = 0
  31.  
  32.     say 'Available file areas:'
  33.  
  34.     do i=1 to FAREALIST.COUNT
  35.         GETFAREADATA fareaname FAREALIST.i stem FAREADATA argument 
  36.         if(rc ~= 0) then 
  37.         do
  38.             say BBSREAD.LASTERROR
  39.             exit
  40.         end
  41.  
  42.         say ' ' || left(FAREALIST.i,20) || right(FAREADATA.NUMFILES, 6)    
  43.         files = files + FAREADATA.NUMFILES
  44.     end
  45.  
  46.     say left("",21) || "------"
  47.     say right("Sum: ", 21) || right(files, 6)
  48.     say left("",21) || "======"
  49.  
  50.     exit
  51.